TARGET = CGView

TEMPLATE = app

CONFIG += \
          opengl \
          thread \

QT += opengl

INCLUDEPATH += . \
               ./vcglib \
               ../Lib/lemon \
               ../Lib/eigen

LIBS += -lemon -lGL -lGLU -lGLEW -lglut

HEADERS = \
          core/engine/engine.h \
          core/gui/opengl/glwindow.h \
          core/gui/opengl/scene/camera/glcamera.h \
          core/gui/opengl/scene/light/gllight.h \
          core/gui/mainwindow.h \
          core/gui/statusbar/statusbar.h \
          core/engine/mesh_definition.h \
          core/gui/opengl/mesh/mode/visualmode.h \
          core/gui/opengl/mesh/material/glmaterial.h \
          core/gui/opengl/intro/glintro.h \
          core/gui/opengl/scene/scene.h \
          core/gui/opengl/mesh/glmesh.h \
          core/gui/meshlist/meshlistbox.h \
          modules/motion_segmentation/MotionSegmenter.h \
          modules/motion_segmentation/colorpicker.h \
          modules/motion_segmentation/auxiliartypes.h \
          modules/motion_segmentation/ASilhouette.h \
          modules/of_motion_segmenter/opticalflowsegmenter.h \
          modules/icp/icp.h \
    modules/laplace/laplace.h

SOURCES = \
          core/main.cpp \
          core/engine/engine.cpp \
          core/gui/opengl/glwindow.cpp \
          core/gui/opengl/scene/camera/glcamera.cpp \
          core/gui/opengl/scene/light/gllight.cpp \
          core/gui/opengl/intro/glintro.cpp \
          core/gui/mainwindow.cpp \
          core/gui/opengl/mesh/material/glmaterial.cpp \
          core/gui/opengl/mesh/glmesh.cpp \
          core/gui/statusbar/statusbar.cpp \
          core/gui/meshlist/meshlistbox.cpp \
          modules/motion_segmentation/MotionSegmenter.cpp \
          modules/motion_segmentation/colorpicker.cpp \
          modules/motion_segmentation/debugStuff.cpp \
          modules/motion_segmentation/ASilhouette.cpp \
          modules/of_motion_segmenter/opticalflowsegmenter.cpp \
          modules/icp/icp.cpp \
          vcglib/wrap/ply/plylib.cpp \
    modules/laplace/laplace.cpp


# Cuda sources
CUDA_SOURCES += modules/motion_segmentation/silhouetteKernel.cu
# Project dir and outputs
PROJECT_DIR = /home/ste/Development/RigidPartDecomposition
OBJECTS_DIR = /home/ste/Development/RigidPartDecomposition/Obj
DESTDIR = ./bin

# Path to cuda SDK install
CUDA_SDK = /home/ste/Development/CUDA_SDK/C
# Path to cuda toolkit install
CUDA_DIR = /usr/local/cuda
# GPU architecture
CUDA_ARCH = sm_10
# nvcc flags (ptxas option verbose is always useful)
NVCCFLAGS = --compiler-options -fno-strict-aliasing -use_fast_math --ptxas-options=-v
# include paths
INCLUDEPATH += $$CUDA_DIR/include
INCLUDEPATH += $$CUDA_SDK/common/inc/
INCLUDEPATH += $$CUDA_SDK/../shared/inc/
# lib dirs
QMAKE_LIBDIR += $$CUDA_DIR/lib64
QMAKE_LIBDIR += $$CUDA_SDK/lib
QMAKE_LIBDIR += $$CUDA_SDK/common/lib
# libs - note than i'm using a x_86_64 machine
LIBS += -lcudart #-lcutil_x86_64
# join the includes in a line
CUDA_INC = $$join(INCLUDEPATH,' -I','-I',' ')
# Prepare the extra compiler configuration (taken from the nvidia forum - i'm not an expert in this part)
cuda.input = CUDA_SOURCES
cuda.output = ${OBJECTS_DIR}${QMAKE_FILE_BASE}_cuda.o
cuda.commands = $$CUDA_DIR/bin/nvcc -m64 -g -G -arch=$$CUDA_ARCH -c $$NVCCFLAGS $$CUDA_INC $$LIBS  ${QMAKE_FILE_NAME} -o ${QMAKE_FILE_OUT}
cuda.dependcy_type = TYPE_C
cuda.depend_command = $$CUDA_DIR/bin/nvcc -g -G -M $$CUDA_INC $$NVCCFLAGS   ${QMAKE_FILE_NAME}
# Tell Qt that we want add more stuff to the Makefile
QMAKE_EXTRA_COMPILERS += cuda
